package com.example.baseapp.repository;

import com.example.baseapp.entity.OrderInfo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import java.util.List;

@Repository
public interface OrderInfoRepository extends JpaRepository<OrderInfo, Long> {
    List<OrderInfo> findByUserId(Long userId);
    
    // 根据订单号查询订单
    OrderInfo findByOrderNo(String orderNo);
    
    // 根据用户ID查询订单，按创建时间倒序排列
    List<OrderInfo> findByUserIdOrderByCreateTimeDesc(Long userId);
} 